import { BaseApi } from "@/api/base";
import http from "@/api/http";

class DatasourceApi extends BaseApi {
  constructor(url) {
    super(url);
  }

  listAll = (params: any): Promise<any> => {
    return http.get(this.url + "/listAll", params);
  };

  test = <T>(params: any): Promise<T> => {
    return http.post(this.url + "/test", params);
  };

  listTable = (params: any): Promise<any> => {
    return http.get(this.url + "/listTable", params);
  };

  listField = (params: any): Promise<any> => {
    return http.get(this.url + "/listField", params);
  };
}
export default new DatasourceApi("/system/datasource");
